﻿<UserControl x:Class="Oxage.Views.TransformView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:common="clr-namespace:Oxage.Common"
  xmlns:c="clr-namespace:Oxage.Windows.Controls"
  xmlns:m="clr-namespace:Oxage.Models"
  xmlns:v="clr-namespace:Oxage.Views">
  <UserControl.DataContext>
    <m:TransformViewModel />
  </UserControl.DataContext>
  <Grid x:Name="LayoutRoot">
    <StackPanel>
      
      <Border Background="#595959" CornerRadius="3">
        <Grid Margin="4">
          <Border ClipToBounds="True" CornerRadius="3">
            <Border Background="#444444" CornerRadius="3">
              <Grid Margin="5">
                <Grid.ColumnDefinitions>
                	<ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                	<RowDefinition Height="Auto" />
                  <RowDefinition Height="10" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="10" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="10" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="10" />
                  <RowDefinition Height="200" />
                </Grid.RowDefinitions>
                
                <!-- Transform origin -->
                <!--
                <TextBlock Text="Origin: " Grid.Row="2" Grid.Column="0" Foreground="White" />
                <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding OriginX}" Margin="10,0,0,0" />
                <TextBox Grid.Row="2" Grid.Column="2" Text="{Binding OriginY}" Margin="10,0,0,0" />
                <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding OriginZ}" Margin="10,0,0,0" />
                -->
                
                <!-- Scale -->
                <TextBlock Text="Scale: " Grid.Row="0" Grid.Column="0" Foreground="White" />
                <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding ScaleX}" Margin="10,0,0,0" />
                <TextBox Grid.Row="0" Grid.Column="2" Text="{Binding ScaleY}" Margin="10,0,0,0" />
                <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding ScaleZ}" Margin="10,0,0,0" />
                
                <!-- Translate -->
                <TextBlock Text="Translate: " Grid.Row="2" Grid.Column="0" Foreground="White" />
                <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding TranslateX}" Margin="10,0,0,0" />
                <TextBox Grid.Row="2" Grid.Column="2" Text="{Binding TranslateY}" Margin="10,0,0,0" />
                <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding TranslateZ}" Margin="10,0,0,0" />
                
                <!-- Rotate -->
                <TextBlock Text="Rotate: " Grid.Row="4" Grid.Column="0" Foreground="White" />
                <TextBox Text="90°" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="10,0,0,0" />
                
                <!-- Buttons -->
                <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4">
                  <Button Content="Apply" HorizontalAlignment="Left" Click="Transform_Click" />
                  <!--<Button Content="Reset" HorizontalAlignment="Left" Click="Transform_Click" />-->
                </StackPanel>

                <!-- Preview -->
                <Grid Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="4">
                	<Grid.Resources>
                		<common:GCodePathDataConverter x:Key="GCodeConverter" />
                  </Grid.Resources>
                	<Path Data="{Binding SampleGCode, Converter={StaticResource GCodeConverter}}" Stretch="Fill" StrokeThickness="2" Stroke="White" />
                </Grid>  
                
              </Grid>
            </Border>
          </Border>
        </Grid>
      </Border>
      
    </StackPanel>
  </Grid>
</UserControl>
